<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="network.resources.html">« 资源类型</a></li>
      <li style="float: right;"><a href="ref.network.html">网络 函数 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.network.html">网络</a></li>
    <li>预定义常量</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="network.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">
下列常量作为 PHP 核心的一部分总是可用的。
</p>
  <table class="doctable table">
   <caption><strong><span class="function"><a href="function.openlog.html" class="function">openlog()</a></span> Options</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.log-cons">
      <td><strong><code>LOG_CONS</code></strong></td>
      <td>
       if there is an error while sending data to the system logger,
       write directly to the system console
      </td>
     </tr>

     <tr id="constant.log-ndelay">
      <td><strong><code>LOG_NDELAY</code></strong></td>
      <td>
       open the connection to the logger immediately 
      </td>
     </tr>

     <tr id="constant.log-odelay">
      <td><strong><code>LOG_ODELAY</code></strong></td>
      <td>
       (default) delay opening the connection until the first
       message is logged
      </td>
     </tr>

     <tr id="constant.log-nowait">
      <td><strong><code>LOG_NOWAIT</code></strong></td>
      <td>
      </td>
     </tr>

     <tr id="constant.log-perror">
      <td><strong><code>LOG_PERROR</code></strong></td>
      <td>print log message also to standard error</td>
     </tr>

     <tr id="constant.log-pid">
      <td><strong><code>LOG_PID</code></strong></td>
      <td>include PID with each message</td>
     </tr>

    </tbody>
   
  </table>


  <table class="doctable table">
   <caption><strong><span class="function"><a href="function.openlog.html" class="function">openlog()</a></span> Facilities</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.log-auth">
      <td><strong><code>LOG_AUTH</code></strong></td>
      <td>
       security/authorization messages (use <strong><code>LOG_AUTHPRIV</code></strong> instead
       in systems where that constant is defined)
      </td>
     </tr>

     <tr id="constant.log-authpriv">
      <td><strong><code>LOG_AUTHPRIV</code></strong></td>
      <td>security/authorization messages (private)</td>
     </tr>

     <tr id="constant.log-cron">
      <td><strong><code>LOG_CRON</code></strong></td>
      <td>clock daemon (cron and at)</td>
     </tr>

     <tr id="constant.log-daemon">
      <td><strong><code>LOG_DAEMON</code></strong></td>
      <td>other system daemons</td>
     </tr>

     <tr id="constant.log-kern">
      <td><strong><code>LOG_KERN</code></strong></td>
      <td>kernel messages</td>
     </tr>

     <tr id="constant.log-local0">
      <td><strong><code>LOG_LOCAL0 ... LOG_LOCAL7</code></strong></td>
      <td>reserved for local use, these are not available in Windows</td>
     </tr>

     <tr id="constant.log-lpr">
      <td><strong><code>LOG_LPR</code></strong></td>
      <td>line printer subsystem</td>
     </tr>

     <tr id="constant.log-mail">
      <td><strong><code>LOG_MAIL</code></strong></td>
      <td>mail subsystem</td>
     </tr>

     <tr id="constant.log-news">
      <td><strong><code>LOG_NEWS</code></strong></td>
      <td>USENET news subsystem</td>
     </tr>

     <tr id="constant.log-syslog">
      <td><strong><code>LOG_SYSLOG</code></strong></td>
      <td>messages generated internally by syslogd</td>
     </tr>

     <tr id="constant.log-user">
      <td><strong><code>LOG_USER</code></strong></td>
      <td>generic user-level messages</td>
     </tr>

     <tr id="constant.log-uucp">
      <td><strong><code>LOG_UUCP</code></strong></td>
      <td>UUCP subsystem</td>
     </tr>

    </tbody>
   
  </table>


  <table class="doctable table">
   <caption><strong><span class="function"><a href="function.syslog.html" class="function">syslog()</a></span> Priorities (in descending order)</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.log-emerg">
      <td><strong><code>LOG_EMERG</code></strong></td>
      <td>system is unusable</td>
     </tr>

     <tr id="constant.log-alert">
      <td><strong><code>LOG_ALERT</code></strong></td>
      <td>action must be taken immediately</td>
     </tr>

     <tr id="constant.log-crit">
      <td><strong><code>LOG_CRIT</code></strong></td>
      <td>critical conditions</td>
     </tr>

     <tr id="constant.log-err">
      <td><strong><code>LOG_ERR</code></strong></td>
      <td>error conditions</td>
     </tr>

     <tr id="constant.log-warning">
      <td><strong><code>LOG_WARNING</code></strong></td>
      <td>warning conditions</td>
     </tr>

     <tr id="constant.log-notice">
      <td><strong><code>LOG_NOTICE</code></strong></td>
      <td>normal, but significant, condition</td>
     </tr>

     <tr id="constant.log-info">
      <td><strong><code>LOG_INFO</code></strong></td>
      <td>informational message</td>
     </tr>

     <tr id="constant.log-debug">
      <td><strong><code>LOG_DEBUG</code></strong></td>
      <td>debug-level message</td>
     </tr>

    </tbody>
   
  </table>

  <table class="doctable table">
   <caption><strong><span class="function"><a href="function.dns-get-record.html" class="function">dns_get_record()</a></span> Options</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.dns-a">
      <td><strong><code>DNS_A</code></strong></td>
      <td>IPv4 Address Resource</td>
     </tr>

     <tr id="constant.dns-caa">
      <td><strong><code>DNS_CAA</code></strong></td>
      <td>Certification Authority Authorization Resource (available as of PHP 7.0.16 and 7.1.2)</td>
     </tr>

     <tr id="constant.dns-mx">
      <td><strong><code>DNS_MX</code></strong></td>
      <td>Mail Exchanger Resource</td>
     </tr>

     <tr id="constant.dns-cname">
      <td><strong><code>DNS_CNAME</code></strong></td>
      <td>Alias (Canonical Name) Resource</td>
     </tr>

     <tr id="constant.dns-ns">
      <td><strong><code>DNS_NS</code></strong></td>
      <td>Authoritative Name Server Resource</td>
     </tr>

     <tr id="constant.dns-ptr">
      <td><strong><code>DNS_PTR</code></strong></td>
      <td>Pointer Resource</td>
     </tr>

     <tr id="constant.dns-hinfo">
      <td><strong><code>DNS_HINFO</code></strong></td>
      <td>Host Info Resource (See IANA&#039;s
       <a href="http://www.iana.org/assignments/operating-system-names" class="link external">&raquo;&nbsp;<code class="literal">Operating System Names</code></a>
        for the meaning of these values)</td>
     </tr>

     <tr id="constant.dns-soa">
      <td><strong><code>DNS_SOA</code></strong></td>
      <td>Start of Authority Resource</td>
     </tr>

     <tr id="constant.dns-txt">
      <td><strong><code>DNS_TXT</code></strong></td>
      <td>Text Resource</td>
     </tr>

     <tr id="constant.dns-any">
      <td><strong><code>DNS_ANY</code></strong></td>
      <td>Any Resource Record.  On most systems
        this returns all resource records, however
        it should not be counted upon for critical
        uses. Try <strong><code>DNS_ALL</code></strong> instead.</td>
     </tr>

     <tr id="constant.dns-aaaa">
      <td><strong><code>DNS_AAAA</code></strong></td>
      <td>IPv6 Address Resource</td>
     </tr>

     <tr id="constant.dns-all">
      <td><strong><code>DNS_ALL</code></strong></td>
      <td>Iteratively query the name server for
        each available record type.</td>
     </tr>

    </tbody>
   
  </table>

</div>
</div></div></body></html>